﻿using NUnit.Framework;

namespace SyringeControl.WinForms.Tests
{
    [TestFixture]
    public class Test_SimpleProperty
    {
        [TestCase("SomeProperty")]
        public void Signals_about_changed_value(string propName)
        {
            var prop = new SimpleProperty<int>(propName);
            var propertyChanged = "";
            prop.Changed += s => propertyChanged = s;
            prop.Set(42);
            Assert.That(propertyChanged, Is.EqualTo(propName));
        }
        [Test]
        public void Stores_assigned_value()
        {
            var prop = new SimpleProperty<int>("SomeProperty");
            prop.Set(42);
            Assert.That(prop.Get(), Is.EqualTo(42));
        }
    }
}
